package com.tmindtech.api.mas.dto;

import com.jasson.im.api.APIClient;

import java.lang.reflect.Field;

public class SendingResult {
    private int code;
    private String message;

    public SendingResult(int code) {
        this.code = code;

        Field[] fields = APIClient.class.getFields();
        for (Field field : fields) {
            try {
                if (field.get(null).equals(code)) {
                    message = field.getName();
                    break;
                }
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
